KPI Graphs

wxsGraph List and AOI

Posted by Robert Ward | 11/18/2020

Updated by Robert Ward | 10/19/2023

 

For data points to store and to communicate with the WXS, two steps shall be taken.

First, create an array called “wxsGraphList”, of Data Type “wxsGraphList”, that contains the same number of elements as there are needed for isolated graphs on the project.

The UDT wxsGraphs has the following elements:

  • .ID

    • Data Type: INT
    • Give this graph a unique ID that is not duplicated elsewhere in the array. This can be “1” to start, but be sure not to have another ID be 1 in this array.
  • .Enabled

    • Data Type: BOOL
    • To enable this graph, set this BOOL to a 1. To disable this graph, set the BOOL to a 0.
    • Should the user wish to no longer write data for a graph to the database and/or have the graph show up under the WXS Graphs Page, simply set this BOOL to a 0.
    • NOTE: we do not recommend altering the array to delete elements that are no longer being used. This can be done, but the data is logged via the .ID and therefore if sometime later the .ID was duplicated, all of the data for the old graph could show up under the new graph.
  • .Name

    • Data Type: STRING
    • This is the unique name for this graph. The name entered in here must match the name of the corresponding AOI
    • Max length of this STRING to be (45)
  • .DPxName

    • Data Type: STRING
    • This is the name of the x data point that you wish the WXS to log pertaining to this graph
    • Same for DP1Name through DP5Name
    • Max length of this STRING to be (45)

 


Second, the user can distribute the wxsGraphs_vXX AOI throughout the program, using one AOI instance for each graph.

This AOI is used to trigger and serve data up to the WXS Server.

Explanation of Tags:

  • wxsGraphs_vXX

    • Data Type: wxsGraphs_vXX
    • Use: The tag name entered here must match that of the corresponding wcsGraphList array element.
  • ID

    • Data Type: INT
    • Use: The tag name here must be the .ID element of the corresponding wcsGraphList array.
  • Enabled

    • Data Type: BOOL
    • Use: The tag name here must be the .Enabled element of the corresponding wcsGraphList array.
  • DataPointX

    • Data Type: DINT

    • Use: This tag or constant is used to read a value the user wishes to log when the Trigger is set.

      • When the trigger is set, the system will take a snapshot of current value.
    • This is the same for DataPoint1 through DataPoint5

  • dintTriggerCycleTime_ms

    • Data Type: DINT

    • Use: This is the trigger cycle time in milli-seconds. Therefore, if the user wishes to log data every 1-minute, this should be 1m = 60s = 6000ms

      • Milli-seconds = seconds x 1000
      • Milli-seconds = minutes x 60 x 1000
      • Milli-seconds = hours x 60 x 60 x 1000
      • Example above is logging data every hour

This KB Article has accompanying downloads. Please reach out to your rep to retrieve those.

© 2023 Cedar Creek Software